package com.chris.homecare.components
{
	import feathers.controls.Label;
	import feathers.controls.LayoutGroup;
	import feathers.layout.HorizontalLayout;
	
	public class NameValuePairLabel extends LayoutGroup
	{
		private var nameText:String;
		private var valueText:String;

		private var nameLabel:Label;

		private var valueLabel:Label;
		
		public function NameValuePairLabel(nameText:String, valueText:String)
		{
			this.nameText = nameText;
			this.valueText = valueText;
		}
		
		override protected function initialize():void
		{
			var layout:HorizontalLayout = new HorizontalLayout();
			layout.gap = 8;
			layout.verticalAlign = HorizontalLayout.VERTICAL_ALIGN_BOTTOM;
			this.layout = layout;
			
			nameLabel = new Label();
			nameLabel.text = nameText + ":";
			nameLabel.nameList.add("form-heading-lbl");
			addChild(nameLabel);
			
			valueLabel = new Label();
			valueLabel.text = valueText;
			valueLabel.nameList.add("form-heading-lbl");
			addChild(valueLabel);
			
			super.initialize();
		}
		
		override protected function draw():void
		{
			super.draw();
		}
		
		public function setNameValue(nameText:String, valueText:String):void
		{
			nameLabel.text = nameText + ":";
			valueLabel.text = valueText;
		}
	}
}